fix: look for associated types on parent traits and impls#11745
fix: look for associated types on parent traits and impls#11745
Conversation
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Brillig Execution Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: ab51b64 | Previous: a48028f | Ratio |
|---|---|---|---|
private-kernel-tail |
0.005 s |
0.004 s |
1.25 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Execution Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: ab51b64 | Previous: a48028f | Ratio |
|---|---|---|---|
rollup-checkpoint-merge |
0.003 s |
0.002 s |
1.50 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
|
I'll review this now, but I noticed that (I think!) we don't have a test for when an associated type is defined in both the parent and the child: trait KeyType {
type Key;
}
trait Lookup: KeyType {
type Key;
}
fn find<M: Lookup>(m: M, key: M::Key) {}It works as expected, producing an ambiguity error, but I couldn't find such test. |
I added the test. |
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Test Suite Duration'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: 83ae00e | Previous: 95fc5e9 | Ratio |
|---|---|---|---|
test_report_zkpassport_noir_rsa_ |
2 s |
1 s |
2 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
Description
Problem
Resolves #11562
Summary
Look for associated types in the parents hierarchy for traits and trait impls.
Trait constraints are added for both parent traits and trait impls.
Additional Context
User Documentation
Check one:
PR Checklist
cargo fmton default settings.